package tp.model;

import java.util.ArrayList;
import java.util.Date;

public class Trajet {

	private String id;
	private String nom;
	private Date date;
	//duree en minutes
	private int duree;
	private double distance;
	ArrayList<Ticket> listTickets;
	private Ville depart;
	private Ville arrivee;
	private Train train;

	public Trajet()
	{
		this("",null,0,null,null,null);
	}
	public Trajet(String nom, Date date, double distance, Ville depart,
			Ville arrivee, Train train) {
		System.out.println("pouet");
		this.nom = nom;
		this.date = date;
		this.distance = distance;
		this.depart = depart;
		this.arrivee = arrivee;
		this.train = train;
		listTickets = new ArrayList<Ticket>();
		if(train != null){
			this.duree = (int)(60*distance / train.getVitesse());
		}

//		this.nom = depart.getNom() + "-" + arrivee.getNom() + "_" + date;
//		this.id = depart.getNom() + arrivee.getNom() + date;
		
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public int getDuree() {
		return duree;
	}

	public void setDuree(int duree) {
		this.duree = duree;
	}

	public double getDistance() {
		return distance;
	}

	public void setDistance(double distance) {
		this.distance = distance;
	}

	public ArrayList<Ticket> getListTickets() {
		return listTickets;
	}

	public void setListTickets(ArrayList<Ticket> listTickets) {
		this.listTickets = listTickets;
	}

	public Ville getDepart() {
		return depart;
	}

	public void setDepart(Ville depart) {
		this.depart = depart;
	}

	public Ville getArrivee() {
		return arrivee;
	}

	public void setArrivee(Ville arrivee) {
		this.arrivee = arrivee;
	}

	public Train getTrain() {
		return train;
	}

	public void setTrain(Train train) {
		this.train = train;
	}

}